#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void revese(int* arr, int begin, int end)
{
    while (begin < end)
    {
        int tmp = arr[end];
        arr[end] = arr[begin];
        arr[begin] = tmp;
        begin++;
        end--;
    }
}
void rotate(int* nums, int numsSize, int k) {
    revese(nums, 0, numsSize - k - 1);
    revese(nums, numsSize - k, numsSize - 1);
    revese(nums, 0, numsSize - 1);
}
int main()
{
    int a[7] = { 1,2,3,4,5,6,7};
    int k = 3;
    rotate(a, 7, k);
	return 0;
}